@extends('app')

@section('content')
<h4 class="page-header">青苜社区防灌水设置</h4>
<div class="description2">
    <form action="{{ url('admin/bbs/permission') }}" method="post">
       <table class="table table-striped">
        <tr>
            <td>
                <div class="form-group">
                  <span class="col-sm-4 col-xs-3 control-label">用户对每个问题的回复限制:</span>
                  <div class="col-sm-5 col-xs-8">
                      <label class="radio-inline">
                        <input type="radio" name="answer_unique" value="Y" @if($result['answer_unique'] == 'Y') checked @endif> 只允许回复一次 
                      </label>
                      <label class="radio-inline">
                        <input type="radio" name="answer_unique" value="N" @if($result['answer_unique'] == 'N') checked @endif> 不限制
                      </label>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="form-group">
                  <span class="col-sm-4 col-xs-3 control-label">允许用户回复自己发起的问题:</span>
                  <div class="col-sm-5 col-xs-8">
                      <label class="radio-inline">
                        <input type="radio" name="answer_self_question" value="Y" @if($result['answer_self_question'] == 'Y') checked @endif> 是 
                      </label>
                      <label class="radio-inline">
                        <input type="radio" name="answer_self_question" value="N" @if($result['answer_self_question'] == 'N') checked @endif> 否
                      </label>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="form-group">
                  <span class="col-sm-4 col-xs-3 control-label">用户连续回答问题的时间间隔:</span>
                  <div class="col-sm-5 col-xs-8">
                      <input type="text" name="answer_gap" class="form-control" value="{{ $result['answer_gap'] }}"> 
                      <div class="help-block" >单位：秒</div>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="form-group">
                  <span class="col-sm-4 col-xs-3 control-label">用户连续发布问题的时间间隔:</span>
                  <div class="col-sm-5 col-xs-8">
                      <input type="text" name="question_gap" class="form-control" value="{{ $result['question_gap'] }}"> 
                      <div class="help-block" >单位：秒</div>
                    </div>
                </div>
            </td>
        </tr>
       </table>
        
        {!! csrf_field() !!}
        <div class="form-inline mt20">
            <div class="form-group">
              <input type="hidden" name="stauts" value="1">
              <input type="submit" class="btn btn-primary btn-block" id="save" value="保存" />
            </div>
            <div class="form-group ml30">
                <input type="reset" class="btn btn-default btn-block" value="重置" />
            </div>
        </div>
    </form>
</div>

<script type="text/javascript">
<!--
$(function(){
	/***图片上传****/
	$("#uploadimg").uploadify({
	    'formData'     : {
	        'fileField':'upfile',
	        '_token':'{{ csrf_token() }}',
	        'type':'bbs'
	    },
	    "width"           : 120,
	    "height"          : 30,
	    "queueSizeLimit"  :1,
	    "swf"             : "{{ asset('/js/uploadify/uploadify.swf') }}",
	    "fileObjName"     : "upfile",
	    "buttonText"      : "上传图片",
	    "uploader"        : '/admin/upload/newsimage',
	    'removeTimeout'	  : 1,
	    'fileTypeExts'	  : '*.jpg; *.png; *.gif;',
	    'onUploadSuccess':function(file, data, response){
	    	var data = eval('(' + data + ')');
	        if (data.status == 'success') {

	        	var html="<div style='width:90px; height:60px;float:left;'>"
	            			+"<img width='90' height='60' src='"+data.url+"'  /><input type='hidden' name='icon' value='"+data.url+"' />"
	            			+"</div>"
	            $('#imgbox').html(html);
	        }else{
	            alert(data.msg);
	            return false;
	        }

	    }

	});
});
//-->
</script>
@endsection
